package cn.gson.springboot.model.pojos;

import java.io.Serializable;
import javax.persistence.*;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the registr_from database table.
 * 
 */
@Entity
@Table(name="registr_from")
@NamedQuery(name="RegistrFrom.findAll", query="SELECT r FROM RegistrFrom r")
public class RegistrFrom implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="registr_id")
	private int registrId;

	@Column(name="registrform_time")
	private Timestamp registrformTime;

	@Column(name="registrfrom_lookmoney")
	private BigDecimal registrfromLookmoney;

	@Column(name="registrfrom_moneytype")
	private int registrfromMoneytype;

	@Column(name="registrfrom_name")
	private String registrfromName;
	
	@Column(name="registr_docname")
	private String registrfromDocname;
	
	@Column(name="registr_state")
	private Integer registrfromState;
	
	@Column(name="registr_call")
	private Integer registrCall;

	//bi-directional many-to-one association to LookIllness
	@OneToMany(mappedBy="registrFrom")
	private List<LookIllness> lookIllnesses;

	//bi-directional many-to-one association to ClinicCard
	@ManyToOne
	@JoinColumn(name="clinic_id")
	private ClinicCard clinicCard;

	//bi-directional many-to-one association to RegistrType
	@ManyToOne
	@JoinColumn(name="registrtype_id")
	private RegistrType registrType;

	//bi-directional many-to-one association to Section
	@ManyToOne
	@JoinColumn(name="section_id")
	private Section section;

	public RegistrFrom() {
	}

	public int getRegistrId() {
		return this.registrId;
	}

	public void setRegistrId(int registrId) {
		this.registrId = registrId;
	}

	public Timestamp getRegistrformTime() {
		return this.registrformTime;
	}

	public void setRegistrformTime(Timestamp registrformTime) {
		this.registrformTime = registrformTime;
	}

	public BigDecimal getRegistrfromLookmoney() {
		return this.registrfromLookmoney;
	}

	public void setRegistrfromLookmoney(BigDecimal registrfromLookmoney) {
		this.registrfromLookmoney = registrfromLookmoney;
	}

	public int getRegistrfromMoneytype() {
		return this.registrfromMoneytype;
	}

	public void setRegistrfromMoneytype(int registrfromMoneytype) {
		this.registrfromMoneytype = registrfromMoneytype;
	}

	public String getRegistrfromName() {
		return this.registrfromName;
	}

	public void setRegistrfromName(String registrfromName) {
		this.registrfromName = registrfromName;
	}

	public List<LookIllness> getLookIllnesses() {
		return this.lookIllnesses;
	}

	public void setLookIllnesses(List<LookIllness> lookIllnesses) {
		this.lookIllnesses = lookIllnesses;
	}

	public LookIllness addLookIllness(LookIllness lookIllness) {
		getLookIllnesses().add(lookIllness);
		lookIllness.setRegistrFrom(this);

		return lookIllness;
	}

	public LookIllness removeLookIllness(LookIllness lookIllness) {
		getLookIllnesses().remove(lookIllness);
		lookIllness.setRegistrFrom(null);

		return lookIllness;
	}

	public ClinicCard getClinicCard() {
		return this.clinicCard;
	}

	public void setClinicCard(ClinicCard clinicCard) {
		this.clinicCard = clinicCard;
	}

	public RegistrType getRegistrType() {
		return this.registrType;
	}

	public void setRegistrType(RegistrType registrType) {
		this.registrType = registrType;
	}

	public Section getSection() {
		return this.section;
	}

	public void setSection(Section section) {
		this.section = section;
	}

	public Integer getRegistrfromState() {
		return registrfromState;
	}

	public void setRegistrfromState(Integer registrfromState) {
		this.registrfromState = registrfromState;
	}

	public String getRegistrfromDocname() {
		return registrfromDocname;
	}

	public void setRegistrfromDocname(String registrfromDocname) {
		this.registrfromDocname = registrfromDocname;
	}

	public Integer getRegistrCall() {
		return registrCall;
	}

	public void setRegistrCall(Integer registrCall) {
		this.registrCall = registrCall;
	}
	
	
	
}